package com.hspjava.String_;

public class StringExercise03 {
    public static void main(String[] args) {

        String a = "lfm";
        String b = new String("lfm");
        System.out.println(a.equals(b));//true

        System.out.println(a==b);//false
        System.out.println(a == b.intern());//true
        //false
        System.out.println(b == b.intern());//true(Wrong)


        //b->new 出来的
        //b.intern找到常量池已存在字符串的返回该引用,所以返回a的地址



    }
}
